package com.qinglei.recoup.longconn.service;

import com.google.common.collect.EvictingQueue;

import java.util.ArrayDeque;
import java.util.List;
import java.util.Queue;
import java.util.Stack;

public class MyArray {
    private  Double[] Buffer_HeartReference_P2NL=new Double[60];

    public Double add(Double d){

        return d;
    }

    public static void main(String[] args) {
        Queue<Double>  fifo20= EvictingQueue.create(20);
        Queue<Double>  fifo30= EvictingQueue.create(30);
        Queue<Double>  fifo60= EvictingQueue.create(60);

        for (Double i=1.0;i<100; i++){
            fifo20.offer(i);
            fifo30.offer(i);
            fifo60.offer(i);
        }

        System.out.println(fifo20);
//        System.out.println(fifo30);
//        System.out.println(fifo60);

        System.out.println(counNum(fifo20,90.0));
        System.out.println(fifo20);

        System.out.println(Math.abs(-3));



    }


    public static  int counNum(Queue<Double> queue, Double num){
        int count = 0;
        Queue<Double> queueTmp = new ArrayDeque<>();
        queueTmp.addAll(queue);
        while (!queueTmp.isEmpty()){
            if(queueTmp.poll()>num){
                count++;
            }
        }

        return  count;
    }
}
